package day04;

import java.util.Scanner;

public class GenEx04 {                                  //打分系统
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        double[] pts=new double[5];
        for (int i = 0; i < 5; i++) {
            System.out.println("请第"+(i+1)+"位评委输入0-100之间的分数");
            pts[i]=sc.nextDouble();
        }
        double MAX=pts[0],MIN=pts[0];
        for (int i = 0; i < 5; i++) {
            if (pts[i]>MAX) MAX=pts[i];
            else if (pts[i]<MIN) MIN=pts[i];
        }
        double sum=0;
        for (int i = 0; i < pts.length; i++) {
            sum+=pts[i];
        }
        System.out.println("最终分数为："+((sum-MAX-MIN)/3));
    }
}
